<?php
require('conexion.php');
session_start();
if(isset($_POST['idven'])){
$idven=$_SESSION['idven']=$_POST['idven'];
$ADODB_FETCH_MODE = ADODB_FETCH_BOTH;
$sql = "select id_sucursal,id_empleado from ventas where id_venta='".$idven."'";
$rs = $conn->Execute($sql);
$_SESSION['idsuc']=$rs->fields[0];
$_SESSION['idemp']=$rs->fields[1];
}
if(isset($_SESSION['idsuc'])&&isset($_SESSION['idemp'])){
	header('Location: ./');
	}
?>
<form name="registro" method="post" action="Mventa.php">
Todas las ventas:<?php
$rs=$conn->Execute('select id_venta,id_venta from ventas order by id_venta asc');
echo $rs->getMenu('idven');
?>
<input type="submit" name="ingresar" value="ingresar">
</form>
<form name="ventaT" method="post" action="Mventa.php">
Ventas en ceros:<?php
$rs=$conn->Execute("select id_venta,id_venta from ventas where subtotal='0' and total='0' order by id_venta asc");
echo $rs->getMenu('idven');
?>
<input type="submit" name="ingresar" value="ingresar">
</form>
<form name="ventaC" method="post" action="Mventa.php">
Ventas sin cerrar:<?php
$rs=$conn->Execute("select id_venta,id_venta from ventas where total='0' and subtotal!='0' order by id_venta asc");
echo $rs->getMenu('idven');
?>
<input type="submit" name="ingresar" value="ingresar">
</form>
<a href="login.php">Login</a><br>
<a href="Cventa.php">Ticket venta</a><br>
<a href="productos.php">Ver productos</a><br>
<a href="empleados.php">Ver empleados</a><br>
<a href="cierre.php">Cerrar sesion</a>